from likeshop.base.mybase import Tools


# 提交订单
class settlement_model(Tools):
    # 定义登录路径
    path = "/page/order/buy"

    # 发送登录请求
    def settlement_action(self, zffs, sbid, spsl, yhbz, tjdd, ljgm, dzid, syjf, db):
        mydata = {
            "pay_way": zffs,
            "goods": [{
                "item_id": sbid,
                "num": spsl
            }],
            "remark": yhbz,
            "action": tjdd,
            "type": ljgm,
            "address_id": dzid,
            "use_integral": syjf
        }
        res = self.session.post(url=self.hosturl+self.path, json=mydata, headers=db)
        return res.json()


